home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 119
/
(Vol 119) Nov 09 2010.iso
/
Games
/
tobby_ura_ura.swf
/
scripts
/
DefineSprite_131
/
frame_1
/
DoAction.as
Wrap
Text File
|
2010-11-09
|
1KB
|
76 lines
function main()
{
if(this.procNum == 1)
{
this.checktobby();
}
if(this.procNum == 2)
{
this.endCheck();
}
if(this.procNum == 3)
{
this.passCheck();
}
}
function checktobby()
{
var dx = Math.abs(_root.tobbyMC._x - (_root.mapMC._x + this._x));
if(dx < this.mesXarea && this.outAreaFlg == true)
{
this.openMes();
}
else
{
this.outAreaFlg = true;
}
}
function openMes()
{
this.mesMC.gotoAndStop(this.getLabelName());
this.mesMC._visible = true;
this.openMesFlg = true;
this.pCnt = 60;
this.procNum = 2;
}
function getLabelName()
{
if(_root.gStageNum == 1)
{
var randbase = 0;
}
if(_root.gStageNum == 3)
{
var randbase = 5;
}
if(_root.gStageNum == 6)
{
var randbase = 10;
}
return this.labelNameList[_root.randomInt(5) - 1 + randbase];
}
function endCheck()
{
this.pCnt--;
if(0 >= this.pCnt)
{
this.procNum = 3;
this.mesMC._visible = false;
this.pCnt = 90;
}
}
function passCheck()
{
this.pCnt--;
if(0 >= this.pCnt)
{
this.procNum = 1;
}
}
this.mesMC._visible = false;
this.outAreaFlg = true;
this.mesXarea = 50;
this.pCnt = 0;
this.procNum = 1;
this.labelNameList = ["a","b","c","d","e","a2","b2","c2","d2","e2","a3","b3","c3","d3","e3"];